package com.c6906.vdam.monitor.mapper;

import com.c6906.vdam.monitor.model.DiskUsage;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DiskUsageMapper {

    @Insert("INSERT INTO disk_usage(server_id,msg_serial, host_name, path, total, used, usage_percent, event_time, created_at, updated_at) " +
            "VALUES(#{serverId},#{msgSerial}, #{hostName}, #{path}, #{total}, #{used}, #{usagePercent}, #{eventTime}, #{createdAt}, #{updatedAt})")
    void insertDiskUsage(DiskUsage diskUsage);

    @Select("SELECT * FROM disk_usage WHERE server_id = #{serverId}")
    List<DiskUsage> findByServerId(Long serverId);
}
